#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const ll lnf=0x3f3f3f3f3f3f3f3f;
#define F(i,l,r) for(int i=l;i r;++i)
#define R(i,r,l) for(int i=r;i l;--i)
#define pb push_back
template<class T=int>inline int read(){
	T x=0;bool b=0;char c=getchar();
	while(c<'0'||c>'9') b|=c=='-',c=getchar();
	while(c>='0'&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();
	return b?-x:x;
}
inline char readc(){
	char c=getchar();
	while(isspace(c)) c=getchar();
	return c;
}
namespace{
	const int N=7,M=1e5+3,mod=998244353;
	template<class A,class B>inline void add(A&x,B y){
		x+=y;x=x<mod?x:x-mod;
	}
	const int jc[N]={1,1,2,6,24,120,720};
	int n,m;
	int f[M][720];
	void work(){
		n=read();m=read();
		f[0][0]=1;
		F(i,0,<m){
			vector<int> a;
			F(i,1,<=n) a.pb(i);
			F(j,0,<jc[n]){
				add(f[i+1][j],f[i][j]);
				vector<int> p=a;
				int x=j;
				F(k,1,<n){
					int a=x%jc[n-k+1]/jc[n-k],b=x%jc[n-k]/jc[n-k-1];
					x-=a*jc[n-k]+b*jc[n-k-1];
					x+=b*jc[n-k]+a*jc[n-k-1];
					if(p[k-1]<p[k]) x+=jc[n-k];
					else x-=jc[n-k-1];
					add(f[i+1][x],f[i][j]);
					swap(p[k-1],p[k]);
				}
				next_permutation(a.begin(),a.end());
			}
			// F(j,0,<jc[n]) cerr<<i+1<<" "<<j<<":"<<f[i+1][j]<<'\n';
		}
		cout<<f[m][0];
	}
}
#if 1
#define file(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout)
#else
#define file(x)
#endif
signed main(){file("drama");work();return 0;}